//引入mongoose
let mongoose = require('mongoose');
//创建目标集合模型对象
let errorsSchema = mongoose.Schema({
    studentId: { // 所属学员 _id
        type: mongoose.Schema.Types.ObjectId,
        ref: 'studentsModel'
    },
    exerciseId: {
        type: mongoose.SchemaTypes.ObjectId,
        ref: 'exercisesModel'
    },
    errorAnswer: Array
});
//建立目标模型对象与目标集合的关联关系
mongoose.model('errorsModel', errorsSchema, 'errors');